@echo off  
setlocal  

:: 获取当前日期和时间
for /f "tokens=2 delims==" %%i in ('"wmic os get localdatetime /value"') do set datetime=%%i
set year=%datetime:~0,4%
set month=%datetime:~4,2%
set day=%datetime:~6,2%
set hour=%datetime:~8,2%
set minute=%datetime:~10,2%
set second=%datetime:~12,2%

:: 格式化日期和时间
set formatted_datetime=%year%-%month%-%day% %hour%:%minute%:%second%

:: 添加文件并提交
git add .  
git commit -m "Notes cloud sync at %formatted_datetime%"

:: 推送更改到远程仓库  
:: 这里假设你正在推送当前分支到远程的同名分支  
git push

:: 检查推送是否成功  
if %errorlevel% neq 0 (  
    echo Push failed!  
) else (  
    echo Push succeeded!  
)  

endlocal
pause